<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
    <link rel="stylesheet" type="text/css" th:href="@{{path}/common/v3/summernote/summernote-bs3.css?v={v}(path=${staticPath},v=${v})}"/>
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInLeft">
        <div data-th-replace="common/functionDepict"></div>
        <div>
            <div class="row">
                <div class="pt10">
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>填写信息</h5>
                            </div>
                            <div class="ibox-content clearfix pt10">
                                <form id="bookForm">
                                    <input type="hidden" name="id" th:value="${book['id']}">
                                    <input type="hidden" name="imageJson" th:value="${book['imageJson']}">
                                    <div class="form-horizontal">
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label text-right"><i class="c-red">*</i> 图书名称</label>
                                            <div class="col-sm-8">
                                                <input class="form-control validate-data" name="bookName" th:value="${book['bookName']}" placeholder="图书名称" maxlength="50"/>
                                                <span class="help-block m-b-none c-999">图书名称限制在50个字以内</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <input type="hidden" name="subjectIds" id="subjectIds" th:value="${book['subjectIds']}"/>
                                            <label class="col-sm-1 control-label"><i class="c-red">*</i> 专业项目</label>
                                            <div class="col-sm-8">
                                                <div id="book-open-subject-box"></div>
                                                <div id="book-open-subject-context"></div>
                                                <span class="help-block m-b-none c-999">选择所属专业或新建</span>
                                            </div>
                                            <div class="col-sm-1 mt10"><a href="javascript:void(0)" onclick="getRedirectMenu(baseloaction+'/admin/manage/subject/toSubjectList')"><i class="fa fa-plus"></i> 新建专业</a></div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label text-right"><i class="c-red">*</i>  图书原价</label>
                                            <div class="col-sm-8">
                                                <div class="input-group m-b">
                                                    <span class="input-group-addon">¥</span>
                                                    <input class="form-control price-box" name="rawPrice" th:value="${#strings.isEmpty(book['rawPrice'])}?'0':${book['rawPrice']}" maxlength="6"/>
                                                    <span class="input-group-addon">.00</span>
                                                </div>
                                                <span class="help-block m-b-none c-999"> 原价 可精确到小数点后两位，单位为元</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label text-right"> 实销价</label>
                                            <div class="col-sm-8">
                                                <div class="input-group m-b">
                                                    <span class="input-group-addon">¥</span>
                                                    <input class="form-control price-box" name="realPrice"  th:value="${#strings.isEmpty(book['realPrice'])}?'0':${book['realPrice']}" maxlength="6"/>
                                                    <span class="input-group-addon">.00</span>
                                                </div>
                                                <span class="help-block m-b-none c-999">  实销价 如不填写，默认0.00</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>

                                        <div th:if="${selaSwitch}=='3'">
                                            <div class="form-group">
                                                <label class="col-sm-1 control-label text-right"> 会员价</label>
                                                <div class="col-sm-8">
                                                    <div class="input-group m-b">
                                                        <span class="input-group-addon">¥</span>
                                                        <input class="form-control price-box" name="memberPrice" th:value="${#strings.isEmpty(book['memberPrice'])}?'0':${book['memberPrice']}" maxlength="6"/>
                                                        <span class="input-group-addon">.00</span>
                                                    </div>
                                                    <span class="help-block m-b-none c-999">  实销价 如不填写，默认0.00</span>
                                                </div>
                                            </div>
                                            <div class="hr-line-dashed"></div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-1 control-label text-right">
                                                <i class="c-red">*</i>  库存量</label>
                                            <div class="col-sm-8">
                                                <div class="input-group m-b">
                                                    <span class="input-group-addon"><i class="fa fa-cubes"></i></span>
                                                    <input class="form-control num-bx" name="stockNum" th:value="${#strings.isEmpty(book['stockNum'])}? '0':${book['stockNum']}" maxlength="6"/>
                                                    <span class="input-group-addon">本</span>
                                                </div>
                                                <span class="help-block m-b-none c-999"> 图书库存量</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label text-right"><i class="c-red">*</i> 图书作者</label>
                                            <div class="col-sm-8">
                                                <input class="form-control validate-data" name="author" th:value="${book['author']}" placeholder="图书作者" maxlength="10"/>
                                                <span class="help-block m-b-none c-999">图书作者名限制在10个字以内</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label text-right"><i class="c-red">*</i> 图书出版社</label>
                                            <div class="col-sm-8">
                                                <input class="form-control validate-data" name="bookPress" th:value="${book['bookPress']}" placeholder="图书出版社" maxlength="30"/>
                                                <span class="help-block m-b-none c-999">图书出版社限制在30个字以内</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label text-right"><i class="c-red">*</i> 出版日期</label>
                                            <div class="col-sm-8">
                                                <div class="input-group m-b">
                                                    <span class="input-group-addon">
                                                        <i class="fa fa-hourglass-half"></i>
                                                    </span>
                                                    <input class="form-control layer-date laydate-icon" readonly name="publishTime" th:value="${#strings.isEmpty(book['publishTime'])}?'':${#strings.substring(book['publishTime'],0,10)}" id="publishTime" placeholder="yyyy-MM-dd"/>
                                                </div>
                                                <span class="help-block m-b-none c-999">  出版时间</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label text-right"> 图书页数</label>
                                            <div class="col-sm-8">
                                                <input class="form-control num-bx" name="pageNum" th:value="${#strings.isEmpty(book['pageNum'])}?'0':${book['pageNum']}" placeholder="图书页数" maxlength="6"/>
                                                <span class="help-block m-b-none c-999">图书页数 只能填写正整数</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label text-right"> ISBN</label>
                                            <div class="col-sm-8">
                                                <input class="form-control" name="bookISBN" th:value="${book['bookISBN']}" placeholder="ISBN" maxlength="30"/>
                                                <span class="help-block m-b-none c-999">图书ISBN ISBN指国际标准书号(International Standard Book Number)。一般印刷于图书封底右下方</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label text-right"><i class="c-red">*</i>  图书封面</label>
                                            <div class="col-sm-10">
                                                <p>
                                                    <button class="btn btn-primary " type="button" id="uploadImage"><i class="fa fa-image"></i>&nbsp;上传封面</button>
                                                    <span>
                                                        <small class="fs12 c-red">
                                                            &nbsp;&nbsp;&nbsp;*&nbsp;建议最大尺寸(宽*高 px)：226*340&nbsp;&nbsp;或者比例:&nbsp;2:3
                                                        </small>
                                                    </span>
                                                </p>
                                                <span class="help-block m-b-none c-999">图书销售时的封面</span>
                                                <div class="clearfix" id="coverImage">
                                                    <div class="file-box">
                                                        <div class="file">
                                                            <span class="corner" title="删除" id="remove-image"><i class="fa fa-remove"></i></span>
                                                            <div class="image">
                                                                <img alt="图书封面" id="material-image" class="img-responsive" th:src="!${#maps.isEmpty(book['imageMap'])} ? ${book['imageMap']['pcUrlMap']['large']} : @{{path}/admin/v3/img/default/default-pic.jpg?v={v}(path=${staticPath},v=${v})}"/>
                                                            </div>
                                                            <div class="file-name">
                                                                <p id="file-names" th:text="!${#maps.isEmpty(book['imageMap'])} and ${book['imageMap']['fileName']}!=null ? ${book['imageMap']['fileName']}:'文件名'"></p>
                                                                <small id="create-time" th:text="!${#maps.isEmpty(book['imageMap'])} and ${book['imageMap']['createTime']}!=null ? ${book['imageMap']['createTime']}:'上传时间'"></small>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label text-right"><i class="c-red">*</i> 图书简介</label>
                                            <div class="col-sm-10">
                                                <textarea name="depict" id="depict" th:text="${book['depict']}"></textarea>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label text-right"> 图书目录</label>
                                            <div class="col-sm-10">
                                                <textarea name="contents" id="contents" th:text="${book['contents']}"></textarea>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <div class="col-sm-10 col-sm-offset-2">
                                                <button class="btn btn-danger save-btn" type="button" id="saveReturn">保存，返回</button>
                                                <button th:if="${book['status']}!=1" class="btn btn-primary ml10 save-btn" type="button" id="savePublish">保存，并上架</button>
                                                <button class="btn btn-white ml10" type="button" id="saveCancel">取消</button>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div data-th-replace="layout/head-footer"></div>
    <script type="text/javascript" th:src="@{{path}/admin/business/upload/common-webuploader.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/libs/plugins/layer/laydate/laydate.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/common/summernote/summernote.min.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/business/course/book/save_book.js?v={v}(path=${staticPath},v=${v})}"></script>
</body>
</html>